import os
import sys
import platform

OS_NAME = platform.system();
LIB_DIR=os.environ['LIB_DIR'];
BIN_DIR=os.environ['BIN_DIR'];

env=DefaultEnvironment().Clone()
SOURCES=Glob('table_view/*.c')+Glob('table_row/*.c')+Glob('table_header/*.c')\
  +Glob('table_client/*.c')+Glob('*.c')

EXPORT_DEF=''
if OS_NAME == 'Windows':
  EXPORT_DEF = ' /DEF:"src/table_view.def" '

if os.environ['BUILD_SHARED'] == 'True':
  LIBS=['awtk'];
  LINKFLAGS=env['LINKFLAGS'] + EXPORT_DEF 
  env.SharedLibrary(os.path.join(BIN_DIR, 'table_view'), SOURCES, LIBS=LIBS, LINKFLAGS=LINKFLAGS);
else:
  env.Library(os.path.join(LIB_DIR, 'table_view'), SOURCES);

